SELECT distinct [id]    as partija
      ,[class_name] 
      , [max_value] 
      ,[state]	as kolvo
      ,[place] / dbo.get_whs_length() + 1 as stellj
      ,[place] % dbo.get_whs_width() as polka
  FROM [anton].[dbo].[goods], [anton].[dbo].[class] 
  where goods.name = class.node_id 